import api from "@/api";
export default {
  namespaced: true, //模块
  state() {
    return {
      all: [],
    };
  },
  getters: {},
  mutations: {
    getAll(state, payload) {
      state.all = payload;
    },
  },
  actions: {
    async getAll({ commit }) {
      try {
        let { data } = await api.all();
        commit("getAll", data);
        // console.log(data);
      } catch (err) {
        console.log(err);
      }
    },
  },
};
